home *** CD-ROM | disk | FTP | other *** search
- /* ANSI C code generated by SmallEiffel. */
- /*
- -- SmallEiffel -- Release (- 0.97) -- FRANCE
- -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN
- -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr
- -- CRIN (Centre de Recherche en Informatique de Nancy)
- -- FRANCE
- */
- #include "compile.h"
- T0 *new(int id){
- int sz=s[id];
- T0 *n=malloc(sz);
- memset(n,0,sz);
- n->id=id;
- return n;
- }
- void rT33die_with_code(T33 *C,int a1){
- exit(a1);
- }
- void rT33put_string(T33 *C,T0* a1){
- int _i=0;
- _i=1;
- while (!((_i)>(((T7*)a1)->_count))) {
- rT33put_character(C,rT7_ix64((T7*)a1,_i));
- _i=(_i)+(1);
- }
- }
- T0*oRBC1std_error;
- void rT33crash(T33 *C){
- rsp();
- rT33die_with_code(C,1);
- }
- void rT33copy(T33 *C,T0 * a1){
- /*IF*//*AF*//*AE*/
- memcpy(C,a1,s[C->id]);
- /*FI*/}
- void rT33put_character(T33 *C,char a1){
- char _err='\0';
- _err=fputc(a1,(C)->_output_stream);
- /*IF*/if ((_err)!=(a1)) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms1);
- rT33crash(C);
- }
- /*FI*/}
- void rT33make(T33 *C){
- C->_output_stream=stderr;
- }
- int rT39end_of_input(T39 *C){
- int R=0;
- R=feof((FILE *)(C)->_input_stream);
- return R;
- }
- int rT39is_connected(T39 *C){
- int R=0;
- R=((int)(C)->_path);
- return R;
- }
- void rT39disconnect(T39 *C){
- int _err=0;
- _err=fclose((C)->_input_stream);
- C->_path=NULL;
- }
- T0*oRBC39last_string;
- char rT39last_character(T39 *C){
- char R='\0';
- R=(C)->_last_character_memory;
- return R;
- }
- void rT39connect_to(T39 *C,T0* a1){
- /*(IRF3*/((C)->_mode)=((T0 *)ms26);
- /*)*/C->_input_stream=rT39fopen(C,a1,(C)->_mode);
- /*IF*/{/*AT*/C->_path=a1;
- }
- /*FI*/}
- void rT39skip_separators(T39 *C){
- while (!((rT39end_of_input(C))||(!(rT3is_separator(rT39last_character(C)))))) {
- rT39read_character(C);
- }
- }
- void * rT39fopen(T39 *C,T0* a1,T0* a2){
- void * R=NULL;
- rT7extend((T7*)a1,'\0');
- rT7extend((T7*)a2,'\0');
- R=(T0 *)fopen(((Tstring *)a1)->_storage,((Tstring *)a2)->_storage);
- rT7remove_last((T7*)a1,1);
- rT7remove_last((T7*)a2,1);
- return R;
- }
- void rT39copy(T39 *C,T0 * a1){
- /*IF*//*AF*//*AE*/
- memcpy(C,a1,s[C->id]);
- /*FI*/}
- void rT39read_line_in(T39 *C,T0* a1){
- /*(IRF3*/(((T7*)a1)->_count)=(0);
- /*)*/rT39read_character(C);
- while (!((rT39end_of_input(C))||((rT39last_character(C))==('\12')))) {
- rT7extend((T7*)a1,rT39last_character(C));
- rT39read_character(C);
- }
- }
- void rT39read_line(T39 *C){
- rT39read_line_in(C,oRBC39last_string);
- }
- void rT39read_word(T39 *C){
- rT39skip_separators(C);
- /*(IRF3*/(((T7*)oRBC39last_string)->_count)=(0);
- /*)*/while (!((rT39end_of_input(C))||(rT3is_separator(rT39last_character(C))))) {
- rT7extend((T7*)oRBC39last_string,rT39last_character(C));
- rT39read_character(C);
- }
- }
- void rT39read_character(T39 *C){
- C->_last_character_memory=fgetc((C)->_input_stream);
- }
- char rT7_ix64(T7 *C,int a1){
- char R='\0';
- R=(C->_storage)[a1-1];
- return R;
- }
- void rT7extend(T7 *C,char a1){
- C->_count=((C)->_count)+(1);
- /*IF*/if (((C)->_capacity)<((C)->_count)) {
- /*IF*/if (((C)->_capacity)==(0)) {
- C->_capacity=16;
- C->_storage=(char *)malloc((size_t)C->_capacity);
- }
- else {
- C->_capacity=((C)->_capacity)+(16);
- C->_storage=(char *)realloc(C->_storage,(size_t)C->_capacity);
- }
- /*FI*/}
- /*FI*/rT7put(C,a1,(C)->_count);
- }
- void rT7to_upper(T7 *C){
- int _i=0;
- _i=(C)->_count;
- while (!((_i)==(0))) {
- rT7put(C,rT3to_upper(rT7item(C,_i)),_i);
- _i=(_i)-(1);
- }
- }
- void rT7remove_suffix(T7 *C,T0* a1){
- rT7remove_last(C,((T7*)a1)->_count);
- }
- void rT7remove_between(T7 *C,int a1,int a2){
- int _i=0;
- _i=a2;
- while (!((_i)>=((C)->_count))) {
- rT7put(C,rT7item(C,(_i)+(1)),((a1)+(_i))-(a2));
- _i=(_i)+(1);
- }
- C->_count=((C)->_count)-(((a2)-(a1))+(1));
- }
- void rT7remove_first(T7 *C,int a1){
- /*IF*/if ((a1)>(0)) {
- rT7remove_between(C,1,a1);
- }
- /*FI*/}
- void rT7remove_last(T7 *C,int a1){
- C->_count=((C)->_count)-(a1);
- }
- int rT7has_suffix(T7 *C,T0* a1){
- int R=0;
- int _i2=0;
- int _i1=0;
- /*IF*/if ((((T7*)a1)->_count)<=((C)->_count)) {
- _i1=(((C)->_count)-(((T7*)a1)->_count))+(1);
- _i2=1;
- while (!((((_i1)>((C)->_count))||((_i2)>(((T7*)a1)->_count)))||((rT7item(C,_i1))!=(rT7item((T7*)a1,_i2))))) {
- _i1=(_i1)+(1);
- _i2=(_i2)+(1);
- }
- R=(_i1)>((C)->_count);
- }
- /*FI*/return R;
- }
- char rT7item(T7 *C,int a1){
- char R='\0';
- R=(C->_storage)[a1-1];
- return R;
- }
- int rT7is_equal(T7 *C,T0* a1){
- int R=0;
- int _i=0;
- /*IF*/if (((T0 *)C)==((T0 *)a1)) {
- R=1;
- }
- else {
- _i=(C)->_count;
- R=(_i)==(((T7*)a1)->_count);
- while (!((!(R))||((_i)==(0)))) {
- R=(rT7item(C,_i))==(rT7item((T7*)a1,_i));
- _i=(_i)-(1);
- }
- }
- /*FI*/return R;
- }
- void rT7append(T7 *C,T0* a1){
- int _i=0;
- _i=1;
- while (!((_i)>(((T7*)a1)->_count))) {
- rT7extend(C,rT7_ix64((T7*)a1,_i));
- _i=(_i)+(1);
- }
- }
- char rT7last(T7 *C){
- char R='\0';
- R=rT7item(C,(C)->_count);
- return R;
- }
- void rT7put(T7 *C,char a1,int a2){
- (C->_storage)[a2-1]=a1;
- }
- void rT7swap(T7 *C,int a1,int a2){
- char _tmp='\0';
- _tmp=rT7item(C,a1);
- rT7put(C,rT7item(C,a2),a1);
- rT7put(C,_tmp,a2);
- }
- void rT7copy(T7 *C,T0* a1){
- int _i=0;
- _i=((T7*)a1)->_count;
- C->_count=_i;
- /*IF*/if ((_i)>(0)) {
- /*IF*/if (((C)->_capacity)<(_i)) {
- /*IF*/if (((C)->_capacity)==(0)) {
- C->_storage=(char *)malloc((size_t)_i);
- }
- else {
- C->_storage=(char *)realloc(C->_storage,(size_t)_i);
- }
- /*FI*/C->_capacity=_i;
- }
- /*FI*/while (!((_i)==(0))) {
- rT7put(C,rT7item((T7*)a1,_i),_i);
- _i=(_i)-(1);
- }
- }
- /*FI*/}
- void rT7to_lower(T7 *C){
- int _i=0;
- _i=(C)->_count;
- while (!((_i)==(0))) {
- rT7put(C,rT3to_lower(rT7item(C,_i)),_i);
- _i=(_i)-(1);
- }
- }
- void rT7make(T7 *C,int a1){
- C->_count=0;
- /*IF*/if ((a1)>(0)) {
- /*IF*/if (((C)->_capacity)<(a1)) {
- /*IF*/if (((C)->_capacity)==(0)) {
- C->_storage=(char *)malloc((size_t)a1);
- }
- else {
- C->_storage=(char *)realloc(C->_storage,(size_t)a1);
- }
- /*FI*/C->_capacity=a1;
- }
- /*FI*/}
- /*FI*/}
- int rT2min(T2 C,int a1){
- int R=0;
- /*IF*/if ((C)<(a1)) {
- R=C;
- }
- else {
- R=a1;
- }
- /*FI*/return R;
- }
- int rT2max(T2 C,int a1){
- int R=0;
- /*IF*/if ((a1)<(C)) {
- R=C;
- }
- else {
- R=a1;
- }
- /*FI*/return R;
- }
- char rT2digit(T2 C){
- char R='\0';
- R=rT7item(ms69,(C)+(1));
- return R;
- }
- void rT2append_in(T2 C,T0* a1){
- int _i=0;
- int _val=0;
- /*IF*/if ((C)==(0)) {
- rT7extend((T7*)a1,'0');
- }
- else {
- /*IF*/if ((C)<(0)) {
- rT7extend((T7*)a1,'\55');
- rT2append_in(-(C),a1);
- }
- else {
- _i=(((T7*)a1)->_count)+(1);
- _val=C;
- while (!((_val)==(0))) {
- rT7extend((T7*)a1,rT2digit((_val)%(10)));
- _val=(_val)/(10);
- }
- _val=((T7*)a1)->_count;
- while (!((_i)>=(_val))) {
- rT7swap((T7*)a1,_i,_val);
- _val=(_val)-(1);
- _i=(_i)+(1);
- }
- }
- /*FI*/}
- /*FI*/}
- T0* rT26get_environment_variable(T26 *C,T0* a1){
- T0* R=NULL;
- rT7extend((T7*)a1,'\0');
- R=((T0 *)getenv(((T7 *)a1)->_storage));
- if (R) R=((T0 *)e2s((char *)R));
- rT7remove_last((T7*)a1,1);
- return R;
- }
- int ofBC27x_suffix=0;
- T0*oRBC27x_suffix;
- T0* rT26x_suffix(T26 *C){
- T0* R=NULL;
- if (ofBC27x_suffix==0){
- ofBC27x_suffix=1;
- /*IF*/if (((T0 *)(T0 *)ms32)==((T0 *)rT26system_name(C))) {
- R=(T0 *)ms47;
- }
- else {
- R=(T0 *)ms48;
- }
- /*FI*/oRBC27x_suffix=R;}
- return oRBC27x_suffix;}
- void rT26automat(T26 *C){
- T0* _a=NULL;
- int _arg=0;
- int _state=0;
- _arg=1;
- while (!(((_arg)>(argument_count))||((_state)>(2)))) {
- _a=argument[_arg];
- /*IF*/if (rT7is_equal(ms53,_a)) {
- C->_c_code=1;
- }
- else {
- rT7extend((T7*)(T0 *)ms29,'\40');
- rT7append((T7*)(T0 *)ms29,_a);
- {int iv1=_state;
- if (0 == iv1) goto l2;
- goto l3;
- l2: ;
- /*IF*/if ((rT7item((T7*)_a,1))!=('\55')) {
- /*IF*/if (rT7has_suffix((T7*)_a,(T0 *)ms54)) {
- }
- else if (rT7has_suffix((T7*)_a,(T0 *)ms55)) {
- }
- else if (!((C)->_root)) {
- C->_root=rT26to_bcn(C,_a);
- rT7to_lower((T7*)(C)->_root);
- _state=2;
- }
- /*FI*/}
- else if (rT7is_equal(ms57,_a)) {
- _state=1;
- }
- /*FI*/goto l1;
- l3: ;
- if (1 == iv1) goto l4;
- goto l5;
- l4: ;
- _state=0;
- goto l1;
- l5: ;
- if (2 == iv1) goto l6;
- goto l7;
- l6: ;
- _state=0;
- goto l1;
- l7: ;
- l1: ;
- }
- }
- /*FI*/_arg=(_arg)+(1);
- }
- }
- T0* rT26to_bcn(T26 *C,T0* a1){
- T0* R=NULL;
- char _c='\0';
- int _i=0;
- R=rT26clone(C,a1);
- /*IF*/if (rT7has_suffix((T7*)R,(T0 *)ms56)) {
- rT7remove_last((T7*)R,2);
- }
- /*FI*/_i=((T7*)R)->_count;
- while (!((_i)==(0))) {
- _c=rT7item((T7*)R,_i);
- /*IF*/if (rT3is_letter(_c)) {
- _i=(_i)-(1);
- }
- else if ((_c)==('\137')) {
- _i=(_i)-(1);
- }
- else if (rT3is_digit(_c)) {
- _i=(_i)-(1);
- }
- else {
- rT7remove_first((T7*)R,_i);
- _i=0;
- }
- /*FI*/}
- rT7to_upper((T7*)R);
- return R;
- }
- int ofBC27directory_separator=0;
- T3 oRBC27directory_separator;
- char rT26directory_separator(T26 *C){
- char R='\0';
- if (ofBC27directory_separator==0){
- ofBC27directory_separator=1;
- R=rT7last((T7*)rT26small_eiffel_directory(C));
- oRBC27directory_separator=R;}
- return oRBC27directory_separator;}
- void rT26die_with_code(T26 *C,int a1){
- exit(a1);
- }
- void rT26remove(T26 *C){
- rT38put_character((T38*)oRBC1std_output,'\40');
- rT38put_string((T38*)oRBC1std_output,(T0 *)ms29);
- rT26remove_file(C,(T0 *)ms29);
- }
- void rT26remove_file(T26 *C,T0* a1){
- rT7extend((T7*)a1,'\0');
- remove(((T7 *)a1)->_storage);
- rT7remove_last((T7*)a1,1);
- }
- T0*oRBC27hlp_file_name;
- void rT26add_directory(T26 *C,T0* a1,T0* a2){
- rT7append((T7*)a1,a2);
- rT7extend((T7*)a1,rT26directory_separator(C));
- }
- void rT26print_hlp(T26 *C,T0* a1){
- rT7copy((T7*)oRBC27hlp_file_name,rT26small_eiffel_directory(C));
- rT26add_directory(C,oRBC27hlp_file_name,(T0 *)ms21);
- rT7append((T7*)oRBC27hlp_file_name,a1);
- /*IF*/if (!(rT7has_suffix((T7*)oRBC27hlp_file_name,(T0 *)ms22))) {
- rT7append((T7*)oRBC27hlp_file_name,(T0 *)ms22);
- }
- /*FI*//*IF*/if (!(rT26file_exists(C,oRBC27hlp_file_name))) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms24);
- rT33put_string((T33*)oRBC1std_error,oRBC27hlp_file_name);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms25);
- rT26die_with_code(C,1);
- }
- /*FI*/rT38append_file((T38*)oRBC1std_output,oRBC27hlp_file_name);
- }
- void rT26open_read(T26 *C,T0 * a1,T0* a2){
- rT39connect_to((T39*)a1,a2);
- /*IF*/if (!(rT39is_connected((T39*)a1))) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms37);
- rT33put_string((T33*)oRBC1std_error,a2);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms38);
- rT26die_with_code(C,1);
- }
- /*FI*/}
- T0* rT26clone(T26 *C,T0* a1){
- T0* R=NULL;
- /*IF*/if (((int)a1)) {
- R=(T0 *)new(a1->id);
- AF_1
- XrT28copy(R,a1);
- AF_0
- }
- /*FI*/return R;
- }
- int ofBC27tmp_file_read=0;
- T0*oRBC27tmp_file_read;
- T0 * rT26tmp_file_read(/*C*/void){
- T0 * R=NULL;
- if (ofBC27tmp_file_read==0){
- ofBC27tmp_file_read=1;
- {T39 *n=((T39*)new(39));
- /*(IRF3*/((n)->_mode)=((T0 *)ms26);
- /*)*/R=(T0 *)n;}
- oRBC27tmp_file_read=R;}
- return oRBC27tmp_file_read;}
- void rT26system(T26 *C,T0* a1){
- rT7extend((T7*)a1,'\0');
- system(((T7 *)a1)->_storage);
- rT7remove_last((T7*)a1,1);
- }
- T0*oRBC27system_list;
- int ofBC27system_name=0;
- T0*oRBC27system_name;
- T0* rT26system_name(T26 *C){
- T0* R=NULL;
- int _i=0;
- T0* _path=NULL;
- if (ofBC27system_name==0){
- ofBC27system_name=1;
- _path=rT26clone(C,rT26small_eiffel_directory(C));
- rT26add_directory(C,_path,(T0 *)ms33);
- rT7append((T7*)_path,(T0 *)ms34);
- /*IF*/if (!(rT26file_exists(C,_path))) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms35);
- rT33put_string((T33*)oRBC1std_error,_path);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms36);
- rT26die_with_code(C,1);
- }
- /*FI*/rT26open_read(C,rT26tmp_file_read(),_path);
- rT39read_word((T39*)rT26tmp_file_read());
- R=oRBC39last_string;
- rT39disconnect((T39*)rT26tmp_file_read());
- _i=rT40index_of((T40*)oRBC27system_list,R);
- /*IF*/if ((_i)>(((T40*)oRBC27system_list)->_upper)) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms45);
- rT33put_string((T33*)oRBC1std_error,_path);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms46);
- _i=1;
- while (!((_i)>(((T40*)oRBC27system_list)->_upper))) {
- rT33put_string((T33*)oRBC1std_error,rT40item((T40*)oRBC27system_list,_i));
- rT33put_character((T33*)oRBC1std_error,'\12');
- _i=(_i)+(1);
- }
- }
- else {
- R=rT40item((T40*)oRBC27system_list,_i);
- }
- /*FI*/oRBC27system_name=R;}
- return oRBC27system_name;}
- T0*oRBC1std_output;
- int ofBC27small_eiffel_directory=0;
- T0*oRBC27small_eiffel_directory;
- T0* rT26small_eiffel_directory(T26 *C){
- T0* R=NULL;
- char _slash='\0';
- int _i=0;
- if (ofBC27small_eiffel_directory==0){
- ofBC27small_eiffel_directory=1;
- R=rT26get_environment_variable(C,(T0 *)ms14);
- /*IF*/if (!(R)) {
- R=rT26clone(C,(T0 *)ms14);
- rT7to_upper((T7*)R);
- R=rT26get_environment_variable(C,R);
- /*IF*/if (((int)R)) {
- rT7to_upper((T7*)(T0 *)ms14);
- }
- /*FI*/}
- /*FI*//*IF*/if (!(R)) {
- R=(T0 *)ms20;
- }
- /*FI*/_i=((T7*)R)->_count;
- while (!((_i)<(0))) {
- _slash=rT7item((T7*)R,_i);
- /*IF*/if ((rT3is_letter(_slash))||(rT3is_digit(_slash))) {
- _i=(_i)-(1);
- }
- else {
- _i=-(1);
- }
- /*FI*/}
- /*IF*/if ((_i)==(0)) {
- rT7extend((T7*)R,'\57');
- }
- else if (!((rT7last((T7*)R))==(_slash))) {
- rT7extend((T7*)R,_slash);
- }
- /*FI*/oRBC27small_eiffel_directory=R;}
- return oRBC27small_eiffel_directory;}
- void rT26copy(T26 *C,T0 * a1){
- /*IF*//*AF*//*AE*/
- memcpy(C,a1,s[C->id]);
- /*FI*/}
- int ofBC26make_file=0;
- T0*oRBC26make_file;
- T0 * rT26make_file(/*C*/void){
- T0 * R=NULL;
- if (ofBC26make_file==0){
- ofBC26make_file=1;
- {T39 *n=((T39*)new(39));
- /*(IRF3*/((n)->_mode)=((T0 *)ms26);
- /*)*/R=(T0 *)n;}
- oRBC26make_file=R;}
- return oRBC26make_file;}
- int ofBC27make_suffix=0;
- T0*oRBC27make_suffix;
- T0* rT26make_suffix(T26 *C){
- T0* R=NULL;
- if (ofBC27make_suffix==0){
- ofBC27make_suffix=1;
- /*IF*/if (((T0 *)(T0 *)ms32)==((T0 *)rT26system_name(C))) {
- R=(T0 *)ms58;
- }
- else if (((T0 *)(T0 *)ms42)==((T0 *)rT26system_name(C))) {
- R=(T0 *)ms59;
- }
- else {
- R=(T0 *)ms60;
- }
- /*FI*/oRBC27make_suffix=R;}
- return oRBC27make_suffix;}
- void rT26echo_system(T26 *C){
- rT38put_string((T38*)oRBC1std_output,(T0 *)ms29);
- rT38put_character((T38*)oRBC1std_output,'\12');
- rT26system(C,(T0 *)ms29);
- }
- void rT26make(T26 *C){
- int _i=0;
- T0* _str=NULL;
- /*IF*/if ((argument_count)<(2)) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms5);
- rT26print_hlp(C,(T0 *)ms28);
- rT26die_with_code(C,1);
- }
- /*FI*//*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
- /*)*/rT7append((T7*)(T0 *)ms29,rT26small_eiffel_directory(C));
- rT26add_directory(C,(T0 *)ms29,(T0 *)ms30);
- rT7append((T7*)(T0 *)ms29,(T0 *)ms31);
- rT7append((T7*)(T0 *)ms29,rT26x_suffix(C));
- /*IF*/if (!(rT26file_exists(C,(T0 *)ms29))) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms49);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms50);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms29);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms51);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms14);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms52);
- rT26die_with_code(C,1);
- }
- /*FI*/rT26automat(C);
- _str=rT26clone(C,(C)->_root);
- rT7append((T7*)_str,rT26make_suffix(C));
- /*IF*/if (rT26file_exists(C,_str)) {
- rT26remove_file(C,_str);
- }
- /*FI*/rT26echo_system(C);
- /*IF*/if (!(rT26file_exists(C,_str))) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms63);
- rT33put_string((T33*)oRBC1std_error,_str);
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms64);
- rT26die_with_code(C,1);
- }
- /*FI*/rT38put_string((T38*)oRBC1std_output,(T0 *)ms65);
- rT38put_string((T38*)oRBC1std_output,_str);
- rT38put_string((T38*)oRBC1std_output,(T0 *)ms66);
- rT26open_read(C,rT26make_file(),_str);
- rT39read_line((T39*)rT26make_file());
- while (!(rT39end_of_input((T39*)rT26make_file()))) {
- rT7copy((T7*)(T0 *)ms29,oRBC39last_string);
- rT26echo_system(C);
- rT39read_line((T39*)rT26make_file());
- }
- /*IF*/if ((C)->_c_code) {
- rT38put_string((T38*)oRBC1std_output,(T0 *)ms67);
- }
- else {
- rT38put_string((T38*)oRBC1std_output,(T0 *)ms68);
- _i=1;
- while (!((_i)==(0))) {
- /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
- /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
- rT2append_in(_i,(T0 *)ms29);
- rT7append((T7*)(T0 *)ms29,(T0 *)ms55);
- /*IF*/if (rT26file_exists(C,(T0 *)ms29)) {
- rT26remove(C);
- rT7remove_suffix((T7*)(T0 *)ms29,(T0 *)ms55);
- rT7append((T7*)(T0 *)ms29,(T0 *)ms54);
- rT26remove(C);
- _i=(_i)+(1);
- }
- else {
- _i=0;
- }
- /*FI*/}
- /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
- /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
- rT7append((T7*)(T0 *)ms29,(T0 *)ms70);
- rT26remove(C);
- /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
- /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
- rT7append((T7*)(T0 *)ms29,rT26make_suffix(C));
- rT26remove(C);
- rT38put_character((T38*)oRBC1std_output,'\12');
- }
- /*FI*/rT38put_string((T38*)oRBC1std_output,(T0 *)ms71);
- }
- int rT26file_exists(T26 *C,T0* a1){
- int R=0;
- rT7extend((T7*)a1,'\0');
- {FILE *f=fopen(((T7 *)a1)->_storage,"r");
- R=(f != NULL);
- fclose(f);}
- rT7remove_last((T7*)a1,1);
- return R;
- }
- void rT38die_with_code(T38 *C,int a1){
- exit(a1);
- }
- void rT38put_string(T38 *C,T0* a1){
- int _i=0;
- _i=1;
- while (!((_i)>(((T7*)a1)->_count))) {
- rT38put_character(C,rT7_ix64((T7*)a1,_i));
- _i=(_i)+(1);
- }
- }
- void rT38crash(T38 *C){
- rsp();
- rT38die_with_code(C,1);
- }
- void rT38append_file(T38 *C,T0* a1){
- char _c='\0';
- rT39connect_to((T39*)rT38tmp_file_read(),a1);
- rT39read_character((T39*)rT38tmp_file_read());
- while (!(rT39end_of_input((T39*)rT38tmp_file_read()))) {
- _c=rT39last_character((T39*)rT38tmp_file_read());
- rT38put_character(C,_c);
- rT39read_character((T39*)rT38tmp_file_read());
- }
- rT39disconnect((T39*)rT38tmp_file_read());
- }
- int ofBC34tmp_file_read=0;
- T0*oRBC34tmp_file_read;
- T0 * rT38tmp_file_read(/*C*/void){
- T0 * R=NULL;
- if (ofBC34tmp_file_read==0){
- ofBC34tmp_file_read=1;
- {T39 *n=((T39*)new(39));
- /*(IRF3*/((n)->_mode)=((T0 *)ms26);
- /*)*/R=(T0 *)n;}
- oRBC34tmp_file_read=R;}
- return oRBC34tmp_file_read;}
- void rT38copy(T38 *C,T0 * a1){
- /*IF*//*AF*//*AE*/
- memcpy(C,a1,s[C->id]);
- /*FI*/}
- void rT38put_character(T38 *C,char a1){
- char _err='\0';
- _err=fputc(a1,(C)->_output_stream);
- /*IF*/if ((_err)!=(a1)) {
- rT33put_string((T33*)oRBC1std_error,(T0 *)ms1);
- rT38crash(C);
- }
- /*FI*/}
- void rT38make(T38 *C){
- C->_output_stream=stdout;
- }
- void rT40clear_all(T40 *C){
- T0* _value=NULL;
- rT40set_all_with(C,_value);
- }
- void rT40set_all_with(T40 *C,T0* a1){
- int _i=0;
- _i=(C)->_upper;
- while (!((_i)<((C)->_lower))) {
- rT40put(C,a1,_i);
- _i=(_i)-(1);
- }
- }
- void rT40resize(T40 *C,int a1,int a2){
- int _up=0;
- int _i=0;
- T0* _other=NULL;
- {T40 *n=((T40*)new(40));
- rT40make(n,a1,a2);
- _other=(T0 *)n;}
- _i=rT2max((C)->_lower,((T40*)_other)->_lower);
- _up=rT2min((C)->_upper,((T40*)_other)->_upper);
- while (!((_i)>(_up))) {
- rT40put((T40*)_other,rT40item(C,_i),_i);
- _i=(_i)+(1);
- }
- /*IF*/{/*AT*/free(C->_storage);
- }
- /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
- }
- T0* rT40item(T40 *C,int a1){
- T0* R=NULL;
- R=(C->_storage)[a1-(C->_lower)];
- return R;
- }
- int rT40equal_like(/*C*/T0* a1,T0* a2){
- int R=0;
- /*IF*//*AF*/if (((T0 *)a1)==((T0 *)a2)) {
- R=1;
- }
- else if ((!(a1))||(!(a2))) {
- }
- else {
- R=rT7is_equal((T7*)a1,a2);
- }
- /*FI*/return R;
- }
- int rT40index_of(T40 *C,T0* a1){
- int R=0;
- R=(C)->_lower;
- while (!(((R)>((C)->_upper))||(rT40equal_like(a1,rT40item(C,R))))) {
- R=(R)+(1);
- }
- return R;
- }
- void rT40put(T40 *C,T0* a1,int a2){
- (C->_storage)[a2-(C->_lower)]=a1;
- }
- void rT40copy(T40 *C,T0* a1){
- int _i=0;
- C->_upper=((C)->_lower)-(1);
- /*IF*/if (((C)->_capacity)==(0)) {
- rT40make(C,((T40*)a1)->_lower,((T40*)a1)->_upper);
- }
- else {
- rT40resize(C,((T40*)a1)->_lower,((T40*)a1)->_upper);
- }
- /*FI*/_i=(C)->_lower;
- while (!((_i)>((C)->_upper))) {
- rT40put(C,rT40item((T40*)a1,_i),_i);
- _i=(_i)+(1);
- }
- }
- void rT40make(T40 *C,int a1,int a2){
- /*IF*/{/*AT*/free(C->_storage);
- }
- /*FI*/C->_lower=a1;
- C->_upper=a2;
- C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
- C->_storage=NULL;
- /*IF*/if (((C)->_capacity)>(0)) {
- C->_capacity=((C)->_capacity)+(16);
- C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
- rT40clear_all(C);
- }
- /*FI*/}
- char rT3to_upper(T3 C){
- char R='\0';
- /*IF*/if ((((unsigned char)C))<(97)) {
- R=C;
- }
- else if ((((unsigned char)C))>(122)) {
- R=C;
- }
- else {
- R=(((unsigned char)C))-(32);
- }
- /*FI*/return R;
- }
- int rT3is_digit(T3 C){
- int R=0;
- {int iv1=C;
- if ((48 <= iv1) && (iv1<= 57)) goto l9;
- goto l10;
- l9: ;
- R=1;
- goto l8;
- l10: ;
- l8: ;
- }
- return R;
- }
- int rT3is_letter(T3 C){
- int R=0;
- {int iv1=C;
- if ((65 <= iv1) && (iv1<= 90)) goto l12;
- if ((97 <= iv1) && (iv1<= 122)) goto l12;
- goto l13;
- l12: ;
- R=1;
- goto l11;
- l13: ;
- l11: ;
- }
- return R;
- }
- int rT3is_separator(T3 C){
- int R=0;
- {int iv1=C;
- if (0 == iv1) goto l15;
- if ((9 <= iv1) && (iv1<= 10)) goto l15;
- if (13 == iv1) goto l15;
- if (32 == iv1) goto l15;
- goto l16;
- l15: ;
- R=1;
- goto l14;
- l16: ;
- l14: ;
- }
- return R;
- }
- char rT3to_lower(T3 C){
- char R='\0';
- /*IF*/if ((((unsigned char)C))<(65)) {
- R=C;
- }
- else if ((((unsigned char)C))>(90)) {
- R=C;
- }
- else {
- R=(((unsigned char)C))+(32);
- }
- /*FI*/return R;
- }
- int argument_count;
- T0 **argument;
- void main(int argc, char *argv[]) {initialize();{T26 *n=((T26*)new(26));
- int i;
- argument_count = argc - 1;
- argument = (T0 **)malloc(sizeof(Tstring *)*argc);
- for (i = 0; i < argc ; i++)
- argument[i] = (T0 *)e2s(argv[i]);
- signal(SIGINT,sigrsp);
- signal(SIGQUIT,sigrsp);
- signal(SIGKILL,sigrsp);
- ms1=e2s("Error while writing character.");
- ms5=e2s("Bad use of command `compile\'.\n");
- ms14=e2s("SmallEiffel");
- ms17=e2s("C=a1;");
- ms18=e2s("memcpy(C,a1,s[C->id]);");
- ms20=e2s("/usr/local/logiciel/SmallEiffel");
- ms21=e2s("man");
- ms22=e2s(".hlp");
- ms24=e2s("Unable to find help file \"");
- ms25=e2s("\".\n");
- ms26=e2s("r");
- ms28=e2s("compile");
- ms29=e2s("................................................");
- ms30=e2s("bin");
- ms31=e2s("compile_to_c");
- ms32=e2s("DOS");
- ms33=e2s("bin");
- ms34=e2s("system.se");
- ms35=e2s("Unable to find system name file\n\"");
- ms36=e2s("\".\n");
- ms37=e2s("Cannot read file \"");
- ms38=e2s("\".\n");
- ms39=e2s("UNIX");
- ms40=e2s("DOS");
- ms41=e2s("Macintosh");
- ms42=e2s("OS2");
- ms43=e2s("Amiga");
- ms45=e2s("Unknow system name in file\n\"");
- ms46=e2s("\".\nCurrently handled system :\n");
- ms47=e2s(".EXE");
- ms48=e2s("");
- ms49=e2s("Cannot find command `compile_to_c\'.\n");
- ms50=e2s("File \"");
- ms51=e2s("\" not found.\nEnvironment variable \"");
- ms52=e2s("\" must be set to a correct value.\nOr install not done correctly.\n");
- ms53=e2s("-c_code");
- ms54=e2s(".o");
- ms55=e2s(".c");
- ms56=e2s(".e");
- ms57=e2s("-o");
- ms58=e2s(".BAT");
- ms59=e2s(".CMD");
- ms60=e2s(".make");
- ms63=e2s("File \"");
- ms64=e2s("\" not found. Error(s) during `compile_to_c\'.\n");
- ms65=e2s("C compiling using \"");
- ms66=e2s("\" command file.\n");
- ms67=e2s("C code not removed (-c_code).\n");
- ms68=e2s("Removing: ");
- ms69=e2s("0123456789");
- ms70=e2s(".h");
- ms71=e2s("Done.\n");
- {T0 *R;
- {T33 *n=((T33*)new(33));
- rT33make(n);
- R=(T0 *)n;}
- oRBC1std_error=R;}/*PCO*/
- {T0 *R;
- {T38 *n=((T38*)new(38));
- rT38make(n);
- R=(T0 *)n;}
- oRBC1std_output=R;}/*PCO*/
- {T0 *R;
- R=ma(40,0,6,(T0 *)ms39,(T0 *)ms40,(T0 *)ms41,(T0 *)ms32,(T0 *)ms42,(T0 *)ms43);
- oRBC27system_list=R;}/*PCO*/
- {T0 *R;
- {T7 *n=((T7*)new(7));
- rT7make(n,256);
- R=(T0 *)n;}
- oRBC27hlp_file_name=R;}/*PCO*/
- {T0 *R;
- {T7 *n=((T7*)new(7));
- rT7make(n,256);
- R=(T0 *)n;}
- oRBC39last_string=R;}/*PCO*/
- rT26make(n);
- exit(0);}}
- char *s2e(Tstring *s){
- char *e = (char *)malloc((s->_count)+1);
- memcpy(e,s->_storage,s->_count);
- e[s->_count] = '\0';
- return e;
- }
- Tstring *e2s(char *e){
- Tstring *s = (Tstring *)new(stringId);
- if (e != NULL) {
- s->_capacity = strlen(e) + 1;
- s->_count = (s->_capacity) - 1;
- s->_storage = (char *)malloc(sizeof(char)*s->_capacity);
- strcpy(s->_storage,e);}
- return s;
- }
- T0 *ma(int aid,int eid,int argc,...){
- va_list pa;
- Tarray *a=((Tarray *)new(aid));
- char *store=0;
- a->_capacity=argc;
- a->_lower=1;
- a->_upper=argc;
- a->_storage=0;
- if (argc) {va_start(pa,argc);
- if (eid) store=(char *)malloc(argc*(s[eid]));
- else store=(char *)malloc(argc*(sizeof(T0*)));
- a->_storage=(T0 **)store;
- switch (eid){
- case 0:
- while (argc--){*((T0 **)store)=va_arg(pa,T0 *);
- store+=sizeof(T0 *);}break;
- case 2:case 6:
- while (argc--){*((int *)store)=va_arg(pa,int);
- store+=sizeof(int);}break;
- case 3:
- while (argc--){*((char *)store)=((char)va_arg(pa,int));
- store+=sizeof(char);}break;
- case 4:
- while (argc--){*((float *)store)=va_arg(pa,double);
- store+=sizeof(float);}break;
- case 5:
- while (argc--){*((double *)store)=va_arg(pa,double);
- store+=sizeof(double);}break;
- while (argc--){
- memcpy(*((T0 **)va_arg(pa,T0 *)),store,s[eid]);
- store+=s[eid];}}
- va_end(pa);}
- return (T0 *)a;
- }
- Tstring *ms1;
- Tstring *ms5;
- Tstring *ms14;
- Tstring *ms17;
- Tstring *ms18;
- Tstring *ms20;
- Tstring *ms21;
- Tstring *ms22;
- Tstring *ms24;
- Tstring *ms25;
- Tstring *ms26;
- Tstring *ms28;
- Tstring *ms29;
- Tstring *ms30;
- Tstring *ms31;
- Tstring *ms32;
- Tstring *ms33;
- Tstring *ms34;
- Tstring *ms35;
- Tstring *ms36;
- Tstring *ms37;
- Tstring *ms38;
- Tstring *ms39;
- Tstring *ms40;
- Tstring *ms41;
- Tstring *ms42;
- Tstring *ms43;
- Tstring *ms45;
- Tstring *ms46;
- Tstring *ms47;
- Tstring *ms48;
- Tstring *ms49;
- Tstring *ms50;
- Tstring *ms51;
- Tstring *ms52;
- Tstring *ms53;
- Tstring *ms54;
- Tstring *ms55;
- Tstring *ms56;
- Tstring *ms57;
- Tstring *ms58;
- Tstring *ms59;
- Tstring *ms60;
- Tstring *ms63;
- Tstring *ms64;
- Tstring *ms65;
- Tstring *ms66;
- Tstring *ms67;
- Tstring *ms68;
- Tstring *ms69;
- Tstring *ms70;
- Tstring *ms71;
- void rsp(void){
- printf("Eiffel program crash at run time.\n");
- printf("No trace when using option \"-boost\"\n");
- exit(1);
- }
- void sigrsp(int sig){
- printf("Received signal %d (man signal).\n",sig);
- rsp();
- exit(1);
- }
- void XrT28copy(void *C,T0* a1){
- int id=((T0 *)C)->id;
- if (id <= 33) {
- if (id <= 26) {
- if (id <= 7) {
- rT7copy((T7 *)C,a1);
- } else {
- rT26copy((T26 *)C,a1);
- }} else {
- rT33copy((T33 *)C,a1);
- }} else {
- if (id <= 39) {
- if (id <= 38) {
- rT38copy((T38 *)C,a1);
- } else {
- rT39copy((T39 *)C,a1);
- }} else {
- rT40copy((T40 *)C,a1);
- }}}
- size_t s[43];
- Tstring * gt[43];
- Tstring * g[43];
- char * p[43];
- void initialize(void){
- s[8]=sizeof(T8);
- s[33]=sizeof(T33);
- s[39]=sizeof(T39);
- s[7]=sizeof(T7);
- s[6]=sizeof(T6);
- s[2]=sizeof(T2);
- s[26]=sizeof(T26);
- s[38]=sizeof(T38);
- s[40]=sizeof(T40);
- s[3]=sizeof(T3);
- }
-